package gui.view;

import java.awt.Component;

import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JTable;
import javax.swing.ListCellRenderer;
import javax.swing.UIManager;
import javax.swing.table.JTableHeader;

/**
 * 
 * @author dernasherbrezon
 *
 */
public class RowHeaderRenderer extends JLabel implements ListCellRenderer
{

	public RowHeaderRenderer(JTable table)
	{
		JTableHeader header = table.getTableHeader();
		setOpaque(true);
		setBorder(UIManager.getBorder("TableHeader.cellBorder"));
		setHorizontalAlignment(CENTER);
		setForeground(header.getForeground());
		setBackground(header.getBackground());
		setFont(header.getFont());
	}
	public Component getListCellRendererComponent(JList arg0, Object value,
			int arg2, boolean arg3, boolean arg4)
	{
		setText((value == null) ? "" : value.toString());
		return this;
	}

}
